#include <iostream>
#include <string>

#include "./maxFlow/EK.h"
#include "./maxFlow/OPT.h"
#include "./maxFlow/KS.h"
#include "./maxFlow/Kmeans.h"

using namespace std;


// 高斯-约旦消元求逆矩阵
vector<vector<double>> inverse2(vector<vector<double>>& A)
{
    int n = A.size();
    vector<vector<double>> B(n, vector<double>(n, 0));
    for (int i = 0; i < n; ++i) B[i][i] = 1;
    
    for (int i = 0; i < n; ++i)
    {
        // 如果主元为0，则需要交换行
        int r = i;
        // for (int j = i+1; j < n; ++j) if (fabs(A[j][i]) > fabs(A[r][i])) r = j;
        // if (fabs(A[r][i]) < 1e-6) return vector<vector<double>>(); // 矩阵不可逆
        
        // 将主元归一化
        double tmp = A[r][i];
        for (int j = i; j < n; ++j) A[r][j] /= tmp;
        for (int j = 0; j < n; ++j) B[r][j] /= tmp;
        
        // 消去第i列的其他元素
        for (int j = 0; j < n; ++j)
        {
            if (j == i) continue;
            tmp = A[j][i];
            for (int k = i; k < n; ++k) A[j][k] -= tmp * A[i][k];
            for (int k = 0; k < n; ++k) B[j][k] -= tmp * B[i][k];
        }
    }
    
    return B;
}



int main(int argc, char* argv[]){
    // string file = "../dataset/real/data_00.txt";
    // string file = "../dataset/real/testdata.txt";
    string file = "../dataset/real/convertdata.txt";
    // string file = "CMakeLists.txt";
    // EK_main(file);
    // laplace_main();
    // testProj();
    // test2(); 
    // example_ckks_basics(); 
    l = atoi(argv[1]);
    r = atoi(argv[2]);
    file = string(argv[3]);
    // Hungarian_main(file);
    // oblivious_M(file);
    // secureDistanceCalB(1,1);
    // Kmeans_main();
    // KS_main();
    // printf("%.6lf\n",workerLists[0].loc.first);
    // printf("%.6lf\n",perturbWorkers[0].loc.first);
    return 0;
}
